package wb.is.besti.edu.cd.javalibgame;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by Mr.Z on 2017/12/16.
 */

public class MyDatabaseHelper extends SQLiteOpenHelper{

    private SQLiteDatabase db;
    public static final String CREATE_BOOK = "create table History("
            + "id integer primary key autoincrement, "
            + "content text)";

    private Context mConrtext;

    public MyDatabaseHelper(First_page context, String name, SQLiteDatabase.CursorFactory factory, int version){
        super(context, name, factory, version);
        mConrtext = context;
    }

    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        sqLiteDatabase.execSQL(CREATE_BOOK);
    }
    public void del(){
        if (db==null){
            db = getWritableDatabase();
        }
        db.delete("History","content!=?",new String[]{null});
    }
    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
    }
}













